package testPackage;

import org.testng.IRetryAnalyzer;
import org.testng.annotations.ITestAnnotation;
import org.testng.internal.annotations.IAnnotationTransformer;

import java.lang.reflect.Constructor;
import java.lang.reflect.Method;

/**
 * IAnnotation Transformer 接口，可在运行时修改testNG批注
 */
public class Testng05 implements IAnnotationTransformer {
    public void transform(ITestAnnotation testAnnotation, Class testClass,
                          Constructor testConstructor, Method testMethod){
        IRetryAnalyzer retry = testAnnotation.getRetryAnalyzer();
        if(retry == null)
            testAnnotation.setRetryAnalyzer(Testng04.class);
    }

}
